package wq.test.spring.cloud.ui.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import wq.test.spring.cloud.ui.model.Greeting;
import wq.test.spring.cloud.ui.service.GreetingService;

@RestController
public class GreetingController {
	@Autowired
	GreetingService grService;

	@RequestMapping(value = "/greeting/list")
	public ResponseEntity<List<Greeting>> readUserInfo() {
		List<Greeting> users = grService.searchAll();
		return new ResponseEntity<List<Greeting>>(users, HttpStatus.OK);
	}
}
